package vip.xiaonuo.modular.front.blogtag;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.blogtag.entity.BlogTag;
import vip.xiaonuo.modular.blogtag.param.BlogTagParam;
import vip.xiaonuo.modular.blogtag.service.BlogTagService;

import javax.annotation.Resource;

/**
 * @author liu
 */
@RestController
@RequestMapping("/front/blogTag")
public class FrontBlogTagController {
    @Resource
    private BlogTagService blogTagService;

    @GetMapping("/list")
    public ResponseData list(BlogTagParam blogTagParam) {
        QueryWrapper<BlogTag> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().select(BlogTag::getTagName);
        return new SuccessResponseData(blogTagService.list(queryWrapper));
    }
}
